<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Application_Model_User
 *
 * @author Eugene
 */
class Application_Model_User extends Application_Model_Abstract implements Core_Acl_Role_Interface
{

	// Roles
	const ROLE_GUEST = 'guest';
	const ROLE_MEMBER = 'member';
	const ROLE_MANAGER = 'manager';

	/**
	 * @var int
	 */
	protected $_id;

	/**
	 * @var string
	 */
	protected $_role;

	/**
	 * @var string
	 */
	protected $_name;

	/**
	 * @var string
	 */
	protected $_email;

	/**
	 * @var bool
	 */
	protected $_enabled;

	/**
	 * @var string
	 */
	protected $_password;

	/**
	 *
	 * @return array
	 */
	public function toArray()
	{
		return array(
			'id' => $this->getId(),
			'role' => $this->getRole(),
			'name' => $this->getName(),
			'email' => $this->getEmail(),
			'enabled' => $this->getEnabled(),
			'password' => $this->getPassword()
		);
	}

	/**
	 *
	 * @param int $id
	 * @return Application_Model_User
	 */
	public function setId($id)
	{
		$this->_id = (int) $id;

		return $this;
	}

	/**
	 *
	 * @return int
	 */
	public function getId()
	{
		return $this->_id;
	}

	/**
	 *
	 * @param string $role
	 * @return Application_Model_User
	 */
	public function setRole($role)
	{
		$this->_role = (string) $role;

		return $this;
	}

	/**
	 *
	 * @return string
	 */
	public function getRole()
	{
		return $this->_role;
	}

	/**
	 *
	 * @param string $name
	 * @return Application_Model_User
	 */
	public function setName($name)
	{
		$this->_name = (string) $name;

		return $this;
	}

	/**
	 *
	 * @return string
	 */
	public function getName()
	{
		return $this->_name;
	}

	/**
	 *
	 * @param string $email
	 * @return Application_Model_User
	 */
	public function setEmail($email)
	{
		$this->_email = (string) $email;

		return $this;
	}

	/**
	 *
	 * @return string
	 */
	public function getEmail()
	{
		return $this->_email;
	}

	/**
	 *
	 * @param bool $enabled
	 * @return Application_Model_User
	 */
	public function setEnabled($enabled)
	{
		$this->_enabled = (bool) $enabled;

		return $this;
	}

	/**
	 *
	 * @return bool
	 */
	public function getEnabled()
	{
		return $this->_enabled;
	}

	/**
	 *
	 * @param string $password
	 * @return Application_Model_User
	 */
	public function setPassword($password)
	{
		$this->_password = (string) $password;

		return $this;
	}

	/**
	 *
	 * @return string
	 */
	public function getPassword()
	{
		return $this->_password;
	}

}